<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class CJR_Controller extends CI_Controller {
  
  public function __construct() {
    parent::__construct();
  }
  
  public function loadPage($title, $views) {
    // carrega o modelo de settings e a pasta de templates que esta no banco
    $this->load->model('settings_model');
    $template_folder = $this->settings_model->getTemplateFolder();
    
    // carrega o header
    $this->load->view($template_folder.'/_inc/header', array(
      'title' => $this->settings_model->getPlatformName().' - '.$title,
      'template_folder' => $template_folder
    ));
    
    // carrega cada view passada
    foreach ($views as $view => $data)
      $this->load->view($template_folder.'/'.$view, $data);
    
    // carrega o footer
    $this->load->view($template_folder.'/_inc/footer');
  }
}
